(function($) {
	$.extend({
		"cookie" : {
			"add" : function(name, value, opt) {
				var options = {};
				if (arguments.length > 1 && name != null) {
					if ($.isNumeric(opt)) {
						options.expires = opt;
					} else if ($.isPlainObject(opt)) {
						options = opt;
					}
					if (value == null) {
						options.expires = -1;
					}
					if ($.isNumeric(options.expires)) {
						var time = options.expires;
						var expires = options.expires = new Date();
						expires.setTime(expires.getTime() + time * 1000);
					}
					document.cookie = encodeURIComponent(String(name))
							+ "="
							+ encodeURIComponent(String(value))
							+ (options.expires ? "; expires="
									+ options.expires.toUTCString() : "")
							+ (options.path ? "; path=" + options.path : "")
							+ (options.domain ? "; domain=" + options.domain
									: ""), (options.secure ? "; secure" : "");
				}
			},
			"get" : function(name) {
				if (name != null) {
					var value = new RegExp("(?:^|; )"
							+ encodeURIComponent(String(name)) + "=([^;]*)")
							.exec(document.cookie);
					return value ? decodeURIComponent(value[1]) : null;
				}
			},
			"remove" : function(name) {
				addCookie(name, null, null);
			}
		}
	});
})(jQuery);